package com.yingxin.yxerp.module.activiti.biz.vo.req;

import cn.hutool.core.collection.CollectionUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yingxin.yx.framework.commons.constant.CommonConst;
import com.yingxin.yx.framework.commons.dto.PageIn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 撤销完结申请
 * @author fanchao
 * @since 2022-11-15
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="RevokeFinishDateApplyQueryVo对象", description="撤销完结申请")
public class RevokeFinishDateApplyQueryVo extends PageIn {

    private static final long serialVersionUID = 1L;

    /**
     * 申请单号
     */
    private String applyNo;

    /**
     * 业务单号
     */
    private String businessNo;

    /**
     * 申请人id
     */
    @ApiModelProperty("申请人id")
    private String creatorId;

    /**
     * 申请时间 start
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTimeBegin;

    /**
     * 申请时间 end
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTimeEnd;

    @ApiModelProperty(value = "审核状态 0 审核中 1 通过 -1 未通过 ")
    private String approvalStatus;

    @ApiModelProperty(value = "invalid 含未通过")
    private List<String> checkedList;

    public String getInvalid() {
        return CollectionUtil.isEmpty(checkedList) ? null : (checkedList.contains("invalid") ? CommonConst.TRUE : null);
    }

}
